<html>
<head><meta charset="utf-8"><title>crates-dependency-tracking · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html">crates-dependency-tracking</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="155255592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155255592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155255592">(Jan 16 2019 at 14:08)</a>:</h4>
<p>So <span class="user-mention" data-user-id="116107">@davidtwco</span> / <span class="user-mention" data-user-id="124287">@mw</span> -- I'd like to discuss <a href="https://github.com/rust-lang/rust/pull/55613" target="_blank" title="https://github.com/rust-lang/rust/pull/55613">https://github.com/rust-lang/rust/pull/55613</a>. I can't decide if I think the dependency tracking change will be a problem or not. =)</p>



<a name="155255641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155255641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155255641">(Jan 16 2019 at 14:09)</a>:</h4>
<p>(existing discussion on Zulip <a href="#narrow/stream/131828-t-compiler/topic/.2354618.20extern.20crates.20trait.20suggestions" title="#narrow/stream/131828-t-compiler/topic/.2354618.20extern.20crates.20trait.20suggestions">is here</a>)</p>



<a name="155255668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155255668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155255668">(Jan 16 2019 at 14:09)</a>:</h4>
<p>I'm happy to make any changes, not invested in that solution - it's just all I could find that worked.</p>



<a name="155255838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155255838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155255838">(Jan 16 2019 at 14:11)</a>:</h4>
<p>from a first glance, it looks like this could be trouble since there are several pieces of data that go untracked with these changes.</p>



<a name="155255943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155255943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155255943">(Jan 16 2019 at 14:13)</a>:</h4>
<p>why exactly is the list of crates not a query anymore?</p>



<a name="155256051"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155256051" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155256051">(Jan 16 2019 at 14:14)</a>:</h4>
<p>When a new crate was a loaded after the query was first run (for diagnostic purposes) and the results cached then subsequent invocations of the query don't contain those crates.</p>



<a name="155256135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155256135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155256135">(Jan 16 2019 at 14:15)</a>:</h4>
<p>I see... I would have expected that all crates are loaded before the query engine starts anyway.</p>



<a name="155256194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155256194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155256194">(Jan 16 2019 at 14:16)</a>:</h4>
<p>I imagine other code relies on that too.</p>



<a name="155256225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155256225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155256225">(Jan 16 2019 at 14:16)</a>:</h4>
<p>Do you have a link to an example? I.e. something that shows which crates are loaded so late?</p>



<a name="155256227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155256227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155256227">(Jan 16 2019 at 14:16)</a>:</h4>
<p>All the crates that get used are loaded - but the PR aims to load all those that have an <code>--extern</code> flag (including those that aren't used) so that we can suggest things from them.</p>



<a name="155256279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155256279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155256279">(Jan 16 2019 at 14:17)</a>:</h4>
<p>ie. when a trait is implemented for a <code>u32</code> in an extern crate and you use a function defined by that trait on a <code>u32</code> without having used anything else from that crate - then it wouldn't say <code>try importing external_crate::TraitWithFunctionYouUsed</code>.</p>



<a name="155256351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155256351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155256351">(Jan 16 2019 at 14:18)</a>:</h4>
<p>Could you add an additional query that contains the used crate-nums + any other crate nums that have to be loaded?</p>



<a name="155256500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155256500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155256500">(Jan 16 2019 at 14:20)</a>:</h4>
<p>that query would then only be called when an error message is produced</p>



<a name="155256571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155256571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155256571">(Jan 16 2019 at 14:21)</a>:</h4>
<p>This is what I was thinking too—</p>



<a name="155256586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155256586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155256586">(Jan 16 2019 at 14:22)</a>:</h4>
<p>that we definitely want a single answer to the query, but we perhaps need a "maximal" query</p>



<a name="155256630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155256630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155256630">(Jan 16 2019 at 14:22)</a>:</h4>
<p>i.e., what are all the crate nums that <em>could</em> be loaded</p>



<a name="155256633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155256633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155256633">(Jan 16 2019 at 14:22)</a>:</h4>
<p>and we use that in diagnostic cases</p>



<a name="155256650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155256650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155256650">(Jan 16 2019 at 14:22)</a>:</h4>
<p>(vs a "minimal" query: what are all the crate nums that were needed to resolve names)</p>



<a name="155256656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155256656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155256656">(Jan 16 2019 at 14:22)</a>:</h4>
<p>(which is what we have now)</p>



<a name="155256661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155256661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155256661">(Jan 16 2019 at 14:22)</a>:</h4>
<p>well, sort of</p>



<a name="155256828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155256828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155256828">(Jan 16 2019 at 14:24)</a>:</h4>
<p>yes, that</p>



<a name="155257058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155257058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155257058">(Jan 16 2019 at 14:26)</a>:</h4>
<p>There are a handful of places throughout the compiler that this alternate query would need to be used. </p>
<p>Initially, I did something similar - I speculatively loaded the crates and then created a set with those new numbers and the existing ones - but there are a bunch of places in the compiler that eventually get called to verify that traits exist with the correct functions that call <code>crates</code> themselves and they'd need adjusted too - adjusting just the place where candidates for suggestions are found isn't enough.</p>
<p>I guess I could create a query that does that - which calls <code>crates</code> as it is now and then does the speculative loading - returning and caching the maximal set of crate nums. I'd need to then find the handful of places where <code>crates</code> is called elsewhere that would be required for this suggestion  and then change those too?</p>



<a name="155257260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155257260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155257260">(Jan 16 2019 at 14:29)</a>:</h4>
<p>(I think I understand what you are suggesting, I started writing that message before niko's comments which clarified that slightly)</p>



<a name="155257459"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155257459" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155257459">(Jan 16 2019 at 14:31)</a>:</h4>
<p>ah, right, I remember that now</p>



<a name="155257532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155257532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155257532">(Jan 16 2019 at 14:32)</a>:</h4>
<p>that there are parts of the code that kind of 'don't know' the purpose for which they are invoked</p>



<a name="155257537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155257537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155257537">(Jan 16 2019 at 14:32)</a>:</h4>
<p>though I'm a bit surprised that invoke this crates query in the end</p>



<a name="155257557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155257557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155257557">(Jan 16 2019 at 14:32)</a>:</h4>
<p>do you happen to remember any examples? I guess I could ripgrep around</p>



<a name="155257576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155257576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155257576">(Jan 16 2019 at 14:33)</a>:</h4>
<p>I can find one of them where I realized that was the issue.</p>



<a name="155257598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155257598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155257598">(Jan 16 2019 at 14:33)</a>:</h4>
<p>that'd be help[ful</p>



<a name="155257636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155257636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155257636">(Jan 16 2019 at 14:33)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/041254b81495a5aa67af839e00b890e78ed0cbeb/src/librustc/ty/trait_def.rs#L185" target="_blank" title="https://github.com/rust-lang/rust/blob/041254b81495a5aa67af839e00b890e78ed0cbeb/src/librustc/ty/trait_def.rs#L185">right here</a></p>



<a name="155257727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155257727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155257727">(Jan 16 2019 at 14:34)</a>:</h4>
<p>(and I tried changing that location to try get the speculative crate numbers in case it was just those two locations, but that caused ICEs)</p>



<a name="155257905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155257905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155257905">(Jan 16 2019 at 14:36)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/55613/files#diff-45ff4c3ed02cc75f5b8162af5d9c782bR784" target="_blank" title="https://github.com/rust-lang/rust/pull/55613/files#diff-45ff4c3ed02cc75f5b8162af5d9c782bR784">this was the initial location</a> where I do the speculative loading, changing just this to have those extra crate numbers doesn't ICE but misses an error.</p>



<a name="155257942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155257942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155257942">(Jan 16 2019 at 14:37)</a>:</h4>
<p>(that is, it either suggests traits that are implemented but not in scope OR traits that can be implemented and aren't in scope - I forget which, it was a while ago)</p>



<a name="155258121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155258121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155258121">(Jan 16 2019 at 14:39)</a>:</h4>
<p>(it does both now, with this change)</p>



<a name="155258517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155258517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155258517">(Jan 16 2019 at 14:44)</a>:</h4>
<p>How much of a performance hit would it be to load all known crates eagerly? I imagine that usually most crates <em>are</em> used, right?</p>



<a name="155258704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155258704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155258704">(Jan 16 2019 at 14:46)</a>:</h4>
<p>not necessarily</p>



<a name="155258706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155258706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155258706">(Jan 16 2019 at 14:46)</a>:</h4>
<p>I'm not sure. It'd probably affect the playground worst - since it has 100 crates with <code>--extern</code> flags that most often aren't used. There is only a hit in the error case with the current approach.</p>



<a name="155258717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155258717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155258717">(Jan 16 2019 at 14:46)</a>:</h4>
<p>certainly things like example and test crates don't fit that trend</p>



<a name="155258728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155258728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155258728">(Jan 16 2019 at 14:46)</a>:</h4>
<p>(I haven't looked <span class="user-mention" data-user-id="116107">@davidtwco</span> at the links you sent yet, sorry)</p>



<a name="155258809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155258809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155258809">(Jan 16 2019 at 14:48)</a>:</h4>
<p>ok, looking now. interesting.</p>



<a name="155258823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155258823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155258823">(Jan 16 2019 at 14:48)</a>:</h4>
<p>I mean I guess another option is just to "not do this"</p>



<a name="155258833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155258833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155258833">(Jan 16 2019 at 14:48)</a>:</h4>
<p>I wanted it but I'm not sure how much pain it's worth :)</p>



<a name="155258849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155258849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155258849">(Jan 16 2019 at 14:48)</a>:</h4>
<p>and/or maybe we can provide less precise diagnostics</p>



<a name="155258872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155258872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155258872">(Jan 16 2019 at 14:49)</a>:</h4>
<p>we're using this test to decide whether the trait is implemented for the receiver type, right?</p>



<a name="155258889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155258889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155258889">(Jan 16 2019 at 14:49)</a>:</h4>
<p>conceivably we could just tell the user "this method exists in this trait which is not imported"</p>



<a name="155258901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155258901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155258901">(Jan 16 2019 at 14:49)</a>:</h4>
<p>and not specify basically whether it is implemented or not</p>



<a name="155258970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155258970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155258970">(Jan 16 2019 at 14:50)</a>:</h4>
<p>(I personally don't get much value from knowing whether it is implemented -- usually I have a trait in mind, and if it is not implemented, I often want to fix that)</p>



<a name="155259019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155259019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155259019">(Jan 16 2019 at 14:51)</a>:</h4>
<blockquote>
<p>we're using this test to decide whether the trait is implemented for the receiver type, right?</p>
</blockquote>
<p>Yeah. But I'm fairly sure it's called in other places too because changing just that location and the original one caused ICEs.</p>



<a name="155259056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155259056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155259056">(Jan 16 2019 at 14:51)</a>:</h4>
<p>well</p>



<a name="155259066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155259066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155259066">(Jan 16 2019 at 14:52)</a>:</h4>
<p>not sure quite what you mean</p>



<a name="155259117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155259117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155259117">(Jan 16 2019 at 14:52)</a>:</h4>
<p>that is, not sure quite which changes you made :)</p>



<a name="155259128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155259128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155259128">(Jan 16 2019 at 14:52)</a>:</h4>
<p>If I only made sure that the new crate numbers were present in both those locations then other parts of the compiler would start to ICE.</p>



<a name="155259314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155259314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155259314">(Jan 16 2019 at 14:55)</a>:</h4>
<p>I see. What I meant was more that:</p>



<a name="155259320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155259320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155259320">(Jan 16 2019 at 14:55)</a>:</h4>
<p>if we don't <em>try</em> to verify that the trait is implemented, maybe it works out</p>



<a name="155259382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155259382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155259382">(Jan 16 2019 at 14:56)</a>:</h4>
<p>After I read your message against I was confused as to why I pointed that out.</p>



<a name="155259386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155259386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155259386">(Jan 16 2019 at 14:56)</a>:</h4>
<p>I understand what you mean now.</p>



<a name="155259408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155259408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155259408">(Jan 16 2019 at 14:56)</a>:</h4>
<p>like I said, it may not be worth it at this point...</p>



<a name="155259411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155259411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155259411">(Jan 16 2019 at 14:56)</a>:</h4>
<p>...though I still feel like it's helpful</p>



<a name="155259413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155259413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155259413">(Jan 16 2019 at 14:56)</a>:</h4>
<p>and this is a particular point where people get confused</p>



<a name="155259415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155259415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155259415">(Jan 16 2019 at 14:56)</a>:</h4>
<p>(the need to import a trait)</p>



<a name="155259428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155259428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155259428">(Jan 16 2019 at 14:57)</a>:</h4>
<p>There was at least one person that voiced objection to the other change that was similar to this.</p>



<a name="155259454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155259454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155259454">(Jan 16 2019 at 14:57)</a>:</h4>
<p><a href="https://github.com/integer32llc/rust-playground/issues/445" target="_blank" title="https://github.com/integer32llc/rust-playground/issues/445">https://github.com/integer32llc/rust-playground/issues/445</a></p>



<a name="155274541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155274541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155274541">(Jan 16 2019 at 18:13)</a>:</h4>
<p>yeah, true</p>



<a name="155274545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/crates-dependency-tracking/near/155274545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/crates-dependency-tracking.html#155274545">(Jan 16 2019 at 18:13)</a>:</h4>
<p>playground is sort of an extreme case</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>